<script src="http://code.jquery.com/jquery-2.1.1.min.js"></script>
<link rel="stylesheet" href="/assets/layui/css/layui.css"/>
<script src="/assets/layui/layui.js"></script>
<form class="layui-form" action="" enctype="multipart/form-data" method="POST" > <!-- 提示：如果你不想用form，你可以换成div等任何一个普通元素 -->
    
       
                      <div class="layui-form-item">
                            <label class="layui-form-label" style="width: 130px; margin-left:-35px;">图像:</label>
                        <div class="layui-input-block" style="width:260px;">
                            
                            <img src="{$list.img} "  style="width:40px;">
                               <input type="file" name="img"  required  lay-verify="required">
                            </div>
                          </div>
                
                          <div class="layui-form-item">
                              <label class="layui-form-label" style="width: 130px; margin-left:-35px;">城市选择:</label>
                              <div class="layui-input-block" style="width:260px; "> 
                                 
                                      <!-- 省份 -->
                      <select name="city" id="city"  required  lay-verify="required" >
                        {volist name="citylist" id="vo"}
                        <option value="{$vo['id']}">{$vo['areaname']}</option>
                        {/volist}
                      </select>     
                              </div>
                            </div>
                  
 
                                                      
                  <div class="layui-form-item">
                        <label class="layui-form-label" style="width: 130px; margin-left:-35px;">跳转页面:</label>
                    <div class="layui-input-block" style="width:260px;">
                          <input type="text" name="url" value="{$list['url']}" placeholder="请输入http://链接如http://www.baidu.com"   autocomplete="off" class="layui-input">
                        </div>
                      </div>

            <div class="layui-form-item">
      
            <label class="layui-form-label" style="width: 130px; margin-left:-35px;">状态:</label>
            <div class="layui-input-block" style="width:260px;"> 
                  
                    <input type="radio" name="status"value="0" 	
                    
                    {if condition="($list['status'] neq 1)"}checked{/if} />启用

                    <input type="radio" name="status"value="1"
                    {if condition="($list['status'] eq 1)"}checked{/if}
/>禁用
      </div>
    </div>
    
    <div class="layui-form-item">
      <div class="layui-input-block">
        <button class="layui-btn" lay-submit lay-filter="*" type="submit">立即提交</button>
        <button type="reset" class="layui-btn layui-btn-primary">重置</button>
      </div>
    </div>
    <!-- 更多表单结构排版请移步文档左侧【页面元素-表单】一项阅览 -->
  </form>
 
  <script>
   layui.use(['layer','form'],function(){
			form = layui.form;
			layer = layui.layer;
			$ = layui.jquery;
      form.render();
		});
    
    //各种基于事件的操作，下面会有进一步介绍
 
        
  </script>
 <script>
 form.on('submit(filter)',function(data){
  // layer.msg(JSON.stringify(data.field));
  //   return false;
});
 $('#pro').change(function(){
    $.ajax({
        type:"post",
        url:"{:url('add')}",
        data:'pro_id='+$('#pro').val(),
        dataType:"text",
        success:function(data){
            $('#city').html(data);
        }
    });
});

 
 
 </script>

 



     